package com.hmall.common.clients;

import com.hmall.common.dto.PageDTO;
import com.hmall.common.pojo.Item;
import com.hmall.common.pojo.RequestParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * hm-mall
 * 2024/11/16 9:44
 * ItemClient By 1mZ
 */
@FeignClient(name = "itemservice")
public interface ItemClient {
    @GetMapping("item/{id}")
    Item findById(@PathVariable Integer id);
    @PutMapping("item/stock/{itemId}/{num}")
    public void deStock(@PathVariable Long itemId,
                        @PathVariable Integer num);

    @PostMapping("search/filters")
    Map<String, List<String>> getFilterOptions(@RequestBody RequestParams requestParams);
    @PostMapping("search/list")
    PageDTO<Item> getList(@RequestBody RequestParams requestParams);
}
